.TH "spectral clustering" "" "" "" ""
.SH NAME
.PP
spectral clustering \- A clustering algorithm commonly used in EDA
(exploratory data analysis), using the spectrum (eigenvalues) of the
similarity matrix of the data to perform clustering.
.PP
.SH SYNOPSIS
.PP
\f[C]#include\ <frovedis/ml/clustering/spectral_clustering.hpp>\f[]
.PP
\f[C]spectral_clustering_model<T>\f[]
.PD 0
.P
.PD
frovedis::spectral_clustering(\f[C]rowmajor_matrix<T>\f[]& mat,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int ncluster = 2,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int n_comp = 2,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int niter = 100,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ double eps = 0.01,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ bool norm_laplacian = true,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ bool precomputed = false,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ bool drop_first = false,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ double gamma = 1.0,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int mode = 1)
.PP
\f[C]spectral_clustering_model<T>\f[]
.PD 0
.P
.PD
frovedis::spectral_clustering(\f[C]rowmajor_matrix<T>\f[]&& mat,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int ncluster = 2,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int n_comp = 2,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int niter = 100,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ double eps = 0.01,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ bool norm_laplacian = true,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ bool precomputed = false,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ bool drop_first = false,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ double gamma = 1.0,
.PD 0
.P
.PD
\  \  \  \  \  \  \  \  \  \ int mode = 1)
.SH DESCRIPTION
.PP
Clustering is an unsupervised learning problem whereby we aim to group
subsets of entities with one another based on some notion of similarity.
In spectral clustering, the data points are treated as nodes of a graph.
Thus, clustering is treated as a graph partitioning problem.
The user can provide input in form of co\-ordinate values for graphical
representation or as affinity matrix.
The components or features are identified as per column order in matrix
data.
The nodes are then mapped to a low\-dimensional space that can be easily
segregated to form clusters.
.SS Detailed Description
.SS Public Global Function Documentation
.PP
\f[C]spectral_clustering_model<T>\f[]
.PD 0
.P
.PD
spectral_clustering(mat,ncluster,n_comp,niter,eps,norm_laplacian,precomputed,drop_first,gamma,mode)
.PP
\f[B]Parameters\f[]
.PP
\f[I]mat\f[]: A rowmajor_matrix of type "T"(where T can be either float
or double) containing n\-dimensional data points.
It can be treated as either input data matrix or precomputed affinity
matrix, based on the boolean parameter "precomputed".
The input can be passed as an lvalue or rvalue.
The matrix is internally cleared to save computation memory during the
algorithm, in case the input matrix is a rvalue.
.PD 0
.P
.PD
\f[I]ncluster\f[]: An integer parameter containing the number of
required clusters(Default: 2)
.PD 0
.P
.PD
\f[I]n_comp\f[]: An integer parameter containing the number of
components for clusters(Default: 2)
.PD 0
.P
.PD
\f[I]niter\f[]: An integer parameter containing the maximum number of
iteration count for kmeans(Default: 300)
.PD 0
.P
.PD
\f[I]eps\f[]: A parameter of double type containing the epsilon value
for kmeans(Default: 0.1)
.PD 0
.P
.PD
\f[I]norm_laplacian\f[]: A boolean parameter if set True, then compute
normalized Laplacian else not(Default: true)
.PD 0
.P
.PD
\f[I]precomputed\f[]: A boolean parameter if set False, then internally
affinity matrix is computed based on input matrix otherwise input matrix
is treated as precomputed affinity matrix and internal affinity
computation is skipped(Default: false)
.PD 0
.P
.PD
\f[I]drop_first\f[]: A boolean parameter if set True, then drops the
first eigenvector.
The first eigenvector of a normalized laplacian is full of constants,
thus if drop_first is set true, compute (n_comp+1) eigenvectors and will
drop the first vector.
Otherwise it will calculate n_comp number of eigenvectors(Default:
false)
.PD 0
.P
.PD
\f[I]gamma\f[]: The value required for computing nearby relational
meaningful eigenvalues(Default: 1.0)
.PD 0
.P
.PD
\f[I]mode\f[]: A parameter required to set the eigen computation method.
It can be either 1 or 3, 1 for generic and 3 for shift\-invert
mode(Default: 1)
.PP
\f[B]Purpose\f[]
.PD 0
.P
.PD
It computes the clusters with respect to the relational distance between
the given data points, using normalized eigenvectors.
.PD 0
.P
.PD
After the successful clustering, it returns
\f[C]spectral_clustering_model<T>\f[] containing the computed cluster
values.
.PP
\f[B]Return Value\f[]
.PD 0
.P
.PD
After the successful clustering it returns the
\f[C]spectral_clustering_model<T>\f[] from the computed labels
containing the centroids from kmeans.
.SH SEE ALSO
.PP
spectral_clustering_model, spectral_embedding
